package afcp.alumni.service;

import java.util.LinkedList;
import java.util.List;

import net.sourceforge.stripes.action.Message;
import afcp.alumni.action.base.MyActionBeanContext;
import afcp.alumni.file.AlumniFile;
import afcp.alumni.model.db.Member;

public interface UploadService {
	
	public String getUploadUrl(String url);
	
	public void deleteUploadedFiles(MyActionBeanContext context);
	
	public List<Message> readUpload(MyActionBeanContext context, AlumniFile file, FileUploadService fileUploadService);
	
	public static class Uploader {
		
		private List<Member> memberIndexingBuffer = new LinkedList<>();

		public List<Member> getMemberIndexingBuffer() {
			return memberIndexingBuffer;
		}

		public void setMemberIndexingBuffer(List<Member> memberIndexingBuffer) {
			this.memberIndexingBuffer = memberIndexingBuffer;
		}
		
	}

	void uploadMember(Member member, List<Message> failures, Uploader uploader);

	void flushUploadMember(Uploader uploader);

}
